# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=atkmm

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.22.7
pkgrel=2
pkgdesc="C++ bindings for atk (mingw-w64)"
arch=('any')
url="http://gtkmm.sourceforge.net"
license=("LGPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
    "${MINGW_PACKAGE_PREFIX}-libsigc++"
    "${MINGW_PACKAGE_PREFIX}-glibmm>=2.36.0"
    "${MINGW_PACKAGE_PREFIX}-atk"
    )
options=(strip staticlibs)
source=("http://ftp.gnome.org/pub/GNOME/sources/atkmm/${pkgver%.*}/atkmm-$pkgver.tar.xz")
md5sums=('fec7db3fc47ba2e0c95d130ec865a236')

build() {
  CPPFLAGS+=" -D_REENTRANT"
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --enable-shared \
    --enable-static \
    --disable-documentation
  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="$pkgdir" install
  find "${pkgdir}${MINGW_PREFIX}" -name '*.def' -o -name '*.exp' | xargs -rtl1 rm
}
